package cn.bj.yu.function;

import java.util.function.Consumer;

/**
 * @author 周宇
 * @create 2020-08-14 16:05
 * 消费新接口 Consumer 只有输入，返回值
 */
public class ConsumerDemo {
    public static void main(String[] args) {
        Consumer<String> consumer = new Consumer<String>() {
            @Override
            public void accept(String str) {
                System.out.println(str);
            }
        };
        //lambda优化
        Consumer<String> lconsumer = (str) -> {
            System.out.println(str);
        };
        consumer.accept("asd");
        lconsumer.accept("asd");
    }
}